package com.tang.algorithm.dynamicProgramming;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/7/25 23:30
 */
public class LeetCode509 {
    public static void main(String[] args) {
        System.out.println(fib(2));
    }
    public static int fib(int N) {
        int a = 0,b = 1,res;
        for (int i = 0; i <N ; i++) {
            res = a+b;
            a=b;
            b=res;
        }
        return a;
    }
}
